package String;

/**
 * @Author Justin Parker
 * @Date 2024/7/12 0012 14:30
 * @Version 1.0
 *
 */
public class ReplaceAllDemo {
    public static void main(String[] args) {
        String str = "a1b2c3d4e5f6g7h8i9j10";
        //将当前字符串中的数字部分替换为“#NUMBER#”
        String str1 = str.replaceAll("[a-zA-Z]+", "#NUMBER#");
        System.out.println(str1);
        /*

         */
        String regex = "(wqnlgb|cnm|dsb|ger|nc|ch|djb|fw|wgnxrbb)";
        String message = "wqnlgb!你TM是个dsb,你ger?户口本上就一页吧？有没有脑子？nc？会不会玩啊？你个fw,wgnxrbb!";
        message = message.replaceAll(regex, "*");
        System.out.println(message);
    }
}
